<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img src="https://img2.baidu.com/it/u=148456742,1398454515&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1723222800&t=e9e73eb226bf3e4ad49e3b61fcbcb40c" alt="美女" title="美女">
    <input s></input>
    <script>
        let img=document.querySelector('img');

        //读取属性
        console.log(img.getAttribute('src'));
        //删除属性
        img.removeAttribute('alt');
        //设置属性
        img.setAttribute('src','https://img0.baidu.com/it/u=633831105,4054360959&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1723222800&t=75876f2bb17bcf9214fbba2057f8ddc3');
        
        //使用方法控制属性 无法完成对布尔属性的控制
    
    
    </script>
</body>
</html>